//Accepted
#include <cstdio>
#include <cctype>

char a[101],b[101];
bool c, u;
int i, j;

bool process(){
	if(a[0]<'a')return 1;
	c=u=0;
	for(i=0;a[i];i++){
		if(isupper(a[i]))c=1;
		else if(a[i]=='_'){
			u=1;
			if(a[i+1]){
				if(!islower(a[i+1])){
					return 1;
				}
			}else return 1;
		}
	}
	if(c&&!u){//c
		printf("%c", a[0]);
		for(i=1;a[i];i++){
			if(isupper(a[i]))printf("_%c", tolower(a[i]));
			else printf("%c", a[i]);
		}
		return 0;
	}
	else if(!c&&u){//java
		printf("%c", a[0]);
		for(i=1;a[i];i++){
			if(a[i]=='_'&&a[i+1]){
				printf("%c", toupper(a[i+1]));
				++i;
			}
			else printf("%c", a[i]);
		}
		return 0;
	}
	else if(!c&&!u)printf("%s", a);
	else return 1;
	
	return 0;
}

int main(){
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	
	while(scanf("%s", a)==1)
		if(process())printf("Error!\n");
		else printf("\n");
	return 0;
}
